<template>
	<view>
		<view class="essay_cent">
			<jyf-parser :html="content" ref="article" :tag-style="tagStyle"></jyf-parser>
		</view>
	</view>
</template>

<script>
	import jyfParser from "@/components/jyf-parser/jyf-parser";
	export default {
		components: {
			jyfParser
		},
		data() {
			return {
				content: '', //富文本
				tagStyle: {
					img: 'display: block;width: 100%!important;height:auto!important;',
					p: 'margin-bottom: 10rpx;line-height: 50rpx;padding: 0 20rpx;'
				},
			}
		},
		onLoad() {
			//购买须知
			this.getgoo()
		},
		methods: {
			//购买须知
			async getgoo() {
				var that = this
				let datasd = await that.$api.getfyxieyi();
				const regex = new RegExp('<img', 'gi');
				var richtext = datasd.rows[0].content
				richtext = richtext.replace(/<table[^>]*>/gi,
					'<table cellpadding="0" cellspacing="0" max-width="100%" border="1" style="font-size:24rpx;max-width:100%; text-align:left;text-indent: 0em;line-height:24rpx;">'
				);
				that.content = richtext.replace(regex, `<img style="max-width: 100%;"`);
			},
		}
	}
</script>

<style>
	.essay_cent {
		width: 686rpx;
		font-size: 30rpx;
		font-weight: 400;
		letter-spacing: -0.6rpx;
		line-height: 54rpx;
		color: rgba(60, 60, 60, 1);
		margin: 0 auto;
	}
</style>